<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta name="robots" content="noindex,nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="css/x.css"/>
<title>系统账号编辑</title>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<script src="layui/layui.js" type="text/javascript"></script>
</head>
<body>
<!--当前导航-->

<div class="layui-fluid">
  <div class="r_content pd15">
    <div style="overflow-x: auto">
		<?php
		$row = $dsql->GetOne("Select * From `sea_admin` where id='$id'");
		?>
<div class="pda15">编辑管理员：</div>
<form action="?action=save&id=<?php echo $id;?>" method="post" name="editmanager" class="layui-form" enctype="multipart/form-data">

	<div class="layui-form-item">
		<label class="layui-form-label">用 户 名：</label>
		<div class="layui-input-block">
			<input type="text" id="username" name="username" lay-verify="required" placeholder="请输入用户名"
				autocomplete="off" class="layui-input" value="<?php echo $row['name'];?>"/>
		</div>
	</div> 
	<div class="layui-form-item">
		<label class="layui-form-label">昵　　称：</label>
		<div class="layui-input-block">
			<input type="text" id="nickname" name="nickname" placeholder="请输入昵称"
				autocomplete="off" class="layui-input" value="<?php echo $row['nickname'];?>"/>
		</div>
	</div> 
	<div class="layui-form-item">
		<label class="layui-form-label">密　　码：</label>
		<div class="layui-input-block">
			<input type="password" id="pwd" name="pwd" placeholder="留空则不修改密码"
				autocomplete="off" class="layui-input" value=""/>
		</div>
	</div> 
	<div class="layui-form-item">
		<label class="layui-form-label">密码确认：</label>
		<div class="layui-input-block">
			<input type="password" id="pwd2" name="pwd2"  placeholder="留空则不修改密码"
				autocomplete="off" class="layui-input" value=""/>
		</div>
	</div> 	
	
  <div class="layui-form-item">
    <label class="layui-form-label">管理级别：</label>
    <div class="layui-input-block">
      <input type="radio" name="groupid" value="1" title="系统管理员(拥有所有权限)" lay-filter="groupid" <?php if($row['groupid']==1) echo "checked";?>>
      <input type="radio" name="groupid" value="2" title="网站编辑(只有数据管理权限)" lay-filter="groupid" <?php if($row['groupid']==2) echo "checked";?>>
	  <input type="radio" name="groupid" value="3" title="教师(只有预约录像权限)" lay-filter="groupid" <?php if($row['groupid']==3) echo "checked";?>>  
    </div>
  </div>


  <div id="sel_vod"  <?php if($row['groupid']!=3) echo " style=\"display:none\"";?>>
	<div class="layui-form-item">
		<label class="layui-form-label">默认分类：</label>
		<div class="layui-input-block">
			<select name="v_type" id="v_type" lay-search>
				<option value="">请选择视频分类</option>
				<?php makeTypeOptionSelected(0,"　","",$row['tid'],0);?>
			</select>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">录像频道：</label>
		<div class="layui-input-inline">
			<input type="checkbox" name="vod_all"  id="vod_all"  title="全部" lay-skin="primary" <?php if($row['vod_list']=='0' ) echo "checked"; ?>  value="0" />
		</div>
		<?php
			$vlist = explode(",",$row['vod_list']);
			$sqlStr="select id,title from `sea_vod`";
			$dsql->SetQuery($sqlStr);
			$dsql->Execute('vod_list');
			while($row1=$dsql->GetObject('vod_list'))
			{
				$id = $row1->id;
				if(in_array($id,$vlist)){
					$checked = "checked";
				}else{
					$checked = "";
				}
				echo "<div class='layui-input-inline'><input type='checkbox' name='vods[]' title='$row1->title' lay-skin='primary' $checked value='$id' /></div>";	
			}
		?>	
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">发布权限：</label>
		<div class="layui-input-inline">
			<input type="checkbox" name="publish"  id="publish"  title="允许发布到网站首页" lay-skin="primary" <?php if($row['publish']=='1' ) echo "checked"; ?>  value="1" />
		</div>
	</div>

  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">是否锁定：</label>
    <div class="layui-input-block">
      <input type="radio" name="state" value="1" title="激活" <?php if($row['state']==1) echo "checked";?>>
      <input type="radio" name="state" value="0" title="锁定" <?php if($row['state']==0) echo "checked";?>>
    </div>
  </div>	
  
	<div class="layui-form-item">
	  <div class="layui-input-block">
		<input type="submit" name="Submit" value="确定提交" lay-submit="" class="layui-btn"/>
		<input type="reset" name="reset" value="清除重置" class="layui-btn layui-btn-primary" />
	  </div>
	</div>   	

</form>

</div>
</div>
</div>
</body>
<script type="text/JavaScript">

	layui.use(['jquery', 'form'], function(){
	
		$ = layui.jquery;
		form = layui.form;
		 
		form.on('radio(groupid)', function(data){
			if(data.value == "3"){
				$("#sel_vod").css('display','block'); 
				
			}else{
				$("#sel_vod").css('display','none'); 
			}
		});	
		
		
	  });
</script>
</html>
